﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace AppConfigurationMVC.Models
{
    public class AppConfigurationDataAccess
    {
        public List<AppConfiguration> GetConfig()
        {
            List<AppConfiguration> configs = new List<AppConfiguration>();

            for (int i = 1; i <= 3; i++)
            {
                AppConfiguration cnfg = new AppConfiguration();
                cnfg.ConfigID = i;
                cnfg.ConfigKey = "ConnectionString" + i.ToString();
                cnfg.ConfigValue = "Datastore = local;initial catalog = appconfig" + i.ToString() + ";integrated security = sspi";
                cnfg.RecordCreateTime = DateTime.Now;
                cnfg.RecordUpdateTime = DateTime.Now;
                cnfg.Comment = "Secondary database connection #" + i.ToString();

                configs.Add(cnfg);
            }

            return configs;

        }
    }
}